<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      border: 1px solid red;
      width: 150px;
      height: 50px;
      text-align: center;
      line-height: 50px;
    }
  </style>
</head>

<body>
  <div></div>
  <script>
    const spec = { size: '40cm*40cm', color: '黑色' }
    // 1.所有的属性值获取过来
    // console.log(Object.values(spec))
    // 2.转化为字符串  join('/')
    // console.log(Object.values(spec).join('/'))
    document.querySelector('div').innerHTML = Object.values(spec).join('/')
  </script>
</body>

</html>